#pragma once

#include "BasicType.h"
#include "Character.h"

namespace LightPlayer{

	class LightAbstractRenderer;

	class Bitmap : public Character {
		uint16					m_CharacterId;
		uint16					m_Width;
		uint16					m_Height;
		uint8*					m_Buffer_RGBA;
		uint32					m_RendererTextureKey;

	protected:
		void FillFromIndexColor( Stream* stream, const TAG& actual_tag );
		void FillFrom15RGB( Stream* stream, const TAG& actual_tag );
		void FillFrom24RGB( Stream* stream, const TAG& actual_tag );
	
	public:

		Bitmap();
		virtual ~Bitmap();
		void init();
		void readFromStream(Stream* stream, const TAG& actual_tag, LightAbstractRenderer* pRenderer = NULL );

		uint16					getWidth() const															{return m_Width;}
		uint16					getHeight() const															{return m_Height;}
		uint32					getRendererTextureKey() const												{return m_RendererTextureKey;}
		// character interface
		virtual eCharacterType	getType()	const															{return eBitmapCharacter;};
		virtual uint16			getCharacterId()	const													{return m_CharacterId;};
				void			setCharacterId(uint16 characterId)											{m_CharacterId = characterId;};
		virtual void			draw(LightAbstractRenderer* pRenderer, SceneObject* pInstance)				{assert(0);};
	};

};